package com.nbsaas.boot.quartz.rest.convert;

import com.nbsaas.boot.quartz.data.entity.SchedulingTask;
import com.nbsaas.boot.quartz.api.domain.request.SchedulingTaskRequest;

import org.springframework.beans.BeanUtils;
import com.nbsaas.boot.rest.api.Converter;
import com.nbsaas.boot.utils.BeanDataUtils;

/**
 * 定时任务请求对象转换成实体对象
 */

public class SchedulingTaskEntityConvert implements Converter<SchedulingTask, SchedulingTaskRequest> {

    @Override
    public SchedulingTask convert(SchedulingTaskRequest source) {
        SchedulingTask result = new SchedulingTask();
        BeanDataUtils.copyProperties(source, result);
        return result;
    }
}

